import {createStore} from 'vuex'

export default createStore({
    state: {
        menus: [],  // 菜单
        perms: [],  // 权限
        nick: '',   // 昵称
        avatar: ''  // 头像

    },
    getters: {},
    mutations: {
        setMenus(state, menus) {
            state.menus = menus
        },
        setPerms(state, perms) {
            state.perms = perms
        },
        setNick(state, nick) {
            state.nick = nick
        },
        setAvatar(state, avatar) {
            state.avatar = avatar
        },
        resetState(state) {
            state.menus = []
            state.perms = []
            state.nick = ''
            state.avatar = ''
        }
    },
    actions: {},
    modules: {}
})
